package CConstructorMatcher;

sub match {
	my ($cclass, $definedClasses) = @_; 
	
	my @matched = ();
	
	foreach my $ctor (@{ $cclass->ctors() }) {
		if ($ctor->{scope}) { #is visible
			my $accept = 1;
			foreach my $arg (@{$ctor->{args}}){
				my $argClass = $arg->{class};
				if (!(defined $$definedClasses{$argClass})) {
					$accept = 0;
					last;
				}
			}
			
			push (@matched, $ctor) if ($accept);
		}
	}
	
	return @matched;
}

1;